import socket

HOST='127.0.0.1'
PORT=3434

s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)

s.connect((HOST,PORT))
print("建立了连接%s：%s"%(HOST,PORT))
data=s.recv(1024)
print("接收到数据：",str(data,encoding='utf-8'))
s.close()